/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package qs.crm.modules.serve.sct_service.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author tong
* @date 2023-06-03
**/
@Entity
@Data
@Table(name="sct_service")
public class SctService implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`svr_id`")
    @ApiModelProperty(value = "编号")
    private Long svrId;

    @Column(name = "`svr_type`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "服务类型")
    private String svrType;

    @Column(name = "`svr_title`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "概要")
    private String svrTitle;

    @Column(name = "`svr_cust_no`",nullable = false)
    @NotNull
    /** 防止精度丢失 */
    @JSONField(serializeUsing = ToStringSerializer.class)
    @ApiModelProperty(value = "客户编号")
    private Long svrCustNo;

    @Column(name = "`svr_cust_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户名称")
    private String svrCustName;

    @Column(name = "`svr_status`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "服务状态")
    private String svrStatus;

    @Column(name = "`svr_request`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "服务请求")
    private String svrRequest;

    @Column(name = "`svr_create_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "创建人编号")
    private Long svrCreateId;

    @Column(name = "`svr_create_by`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "创建人名称")
    private String svrCreateBy;

    @Column(name = "`svr_create_date`")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp svrCreateDate;

    @Column(name = "`svr_due_id`")
    @ApiModelProperty(value = "分配给的员工编号")
    private Long svrDueId;

    @Column(name = "`svr_due_to`")
    @ApiModelProperty(value = "分配给的员工姓名	")
    private String svrDueTo;

    @Column(name = "`svr_due_date`")
    @ApiModelProperty(value = "分配时间")
    private Timestamp svrDueDate;

    @Column(name = "`svr_deal`")
    @ApiModelProperty(value = "服务处理	")
    private String svrDeal;

    @Column(name = "`svr_deal_id`")
    @ApiModelProperty(value = "处理人编号")
    private Long svrDealId;

    @Column(name = "`svr_deal_by`")
    @ApiModelProperty(value = "处理人姓名	")
    private String svrDealBy;

    @Column(name = "`svr_deal_date`")
    @ApiModelProperty(value = "处理日期")
    private Timestamp svrDealDate;

    @Column(name = "`svr_result`")
    @ApiModelProperty(value = "结果	")
    private String svrResult;

    @Column(name = "`svr_satisfy`")
    @ApiModelProperty(value = "满意度")
    private Integer svrSatisfy;

    @Column(name = "`is_delete`")
    @NotNull
    @ApiModelProperty(value = "逻辑删除")
    private Boolean isDelete;

    public void copy(SctService source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
